package my.test.memento.multibackup;

import my.test.memento.multistate.Originator;

/**
 * @Author 许玉康
 * @Date 2019/9/30 8:52
 */
public class Client {

    public static void main(String[] args) {
        //定义发起人
        Originator originator = new Originator();
        //定义出备忘录管理员
        Caretaker caretaker = new Caretaker();
        //创建两个备忘录
        caretaker.setMemento("001", originator.createMemento());
        caretaker.setMemento("002", originator.createMemento());
        //恢复一个指定标记的备忘录
        originator.restoreMemento(caretaker.getMemento("001"));
    }
}
